﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed
#pragma once

#include "IMenuItemDefinition.h"

namespace gcmp
{
    class ICommandButtonMenuDefinition;
    /// \brief CommandMenuItem控件数据定义接口
    class GCMP_GUI_BASE_INTERFACE_EXPORT ICommandMenuItemDefinition : public IMenuItemDefinition
    {
    public:
        /// \brief 创建ICommandMenuItemDefinition对象
        ///
        /// \param id       ICommandMenuItemDefinition的id,需保证唯一性
        /// \param commandId    命令ID
        /// \param caption    控件标题
        /// \param tooltip    控件的提示信息
        /// \param iconPath   图标路径
        /// \return  创建出ICommandMenuItemDefinition对象。失败时返回空
        static OwnerPtr<ICommandMenuItemDefinition> Create(const std::wstring& id, const std::wstring& commandId, const std::wstring& caption, const std::wstring& tooltip, const std::wstring& iconPath);

        /// \brief 设置MenuItem上显示的文字
        ///
        /// \param caption 待设置的文字说明
        /// \return true设置成功， false设置失败
        virtual bool SetCaption(const std::wstring& caption) = 0;

        /// \brief 设置MenuItem上显示的图标
        ///
        /// \param iconPath 待设置的图标路径
        /// \return true表示设置成功， false表示设置失败
        virtual bool SetIconPath(const std::wstring& iconPath) = 0;

        /// \brief 设置MenuItem上显示的提示信息
        ///
        /// \param tooltip 待设置的提示信息
        /// \return true表示设置成功， false表示设置失败
        virtual bool SetTooltip(const std::wstring& tooltip) = 0;

        /// \brief 设置check状态
        ///
        /// \param isChecked 待设置的check状态
        /// \return void
        virtual void SetIsChecked(bool isChecked) = 0;

        /// \brief 获取check状态
        virtual bool IsChecked() const = 0;

        /// \brief 设置父菜单
        virtual void SetParentCommandMenuDefinition(ICommandButtonMenuDefinition* pCmdMenuDef) = 0;
    };
}
